function [Nonezero_p,distance,line,F,liyi_index,duan_index]=differ(position)
     [c,d]=size(position);
Nonezero_p=double.empty(0,2);
for i=1:c
        if position(i,1)~=0||position(i,2)~=0
            Nonezero_p=[Nonezero_p;position(i,:)];
        end
end
     [a,b]=size(Nonezero_p);
     for i=1:a-1
         distance(i)=norm(Nonezero_p(i+1,:)-Nonezero_p(i,:));
     end
     mean=sum(distance)/(a-1);
     line=mean*(ones(1,(a-1)));
     F=find(distance>mean);
     
[c1,d1]=size(F);     
index=double.empty(0,1);
liyi_index=double.empty(0,1);
duan_index=double.empty(0,1);
for i=1:d1
  q(i)=distance(F(i))/line(1);
  if q(i)>3
      index=[index;F(i)];
  end
end
[a1,b1]=size(index);
for i=1:a1
    if (distance(index(i)+1)/line(1))>3
        liyi_index=[liyi_index;index(i)+1];
    else
        duan_index=[duan_index;index(i)+1];
    end
end
if isempty(liyi_index)
    liyi_index=0;
end
if isempty(duan_index)
    duan_index=0;
end
end